package com.mirror.repository;

import com.mirror.entity.building.Bed;
import com.mirror.entity.building.Room;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BedRepository extends JpaRepository<Bed, String>, JpaSpecificationExecutor<Bed> {


    Page<Bed> findAllByIsdelAndRoomOrderByBedName(Pageable pageable, boolean isdel, Room r);

    List<Bed> findAllByIsdelAndRoomOrderByBedName(boolean isdel, Room r);

    List<Bed> findAllByIsdelAndRoom_IdOrderByBedName(boolean isdel, String r);
    List<Bed> findAllByIsdel(boolean isdel);

}
